package org.example.test.model;

public class User {

	private String firstname;
	private String lastname;
	private String username;
	private String password;
	private UserDetails userDetails;

	public static class Builder implements IBuilder<User> {

		private String firstname = "";
		private String lastname = "";
		private String username;
		private String password;
		private UserDetails userDetails;

		public Builder(String username, String password) {
			this.username = username;
			this.password = password;
		}

		public Builder firstname(String firstname) {
			this.firstname = firstname;
			return this;
		}

		public Builder lastname(String lastname) {
			this.lastname = lastname;
			return this;
		}

		public Builder userDetails(UserDetails userDetails) {
			this.userDetails = userDetails;
			return this;
		}

		@Override
		public User build() {
			return new User(this);
		}

	}

	private User(Builder builder) {
		this.firstname = builder.firstname;
		this.lastname = builder.lastname;
		this.username = builder.username;
		this.password = builder.password;
		this.userDetails = builder.userDetails;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public UserDetails getUserDetails() {
		return userDetails;
	}

	public void setUserDetails(UserDetails userDetails) {
		this.userDetails = userDetails;
	}

}
